{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "314bfe84",
   "metadata": {},
   "outputs": [
    {
     "ename": "IndentationError",
     "evalue": "expected an indented block (3557869616.py, line 18)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn [4], line 18\u001b[1;36m\u001b[0m\n\u001b[1;33m    if Alipay > good_list[user_choice][1]:\u001b[0m\n\u001b[1;37m                                          ^\u001b[0m\n\u001b[1;31mIndentationError\u001b[0m\u001b[1;31m:\u001b[0m expected an indented block\n"
     ]
    }
   ],
   "source": [
    "good_list = [\n",
    "    [\"牛肉\",6],\n",
    "    [\"羊肉\",7],\n",
    "    [\"澳洲牛排\",10],\n",
    "    [\"澳洲龙虾\",12],\n",
    "]\n",
    "shopping = []\n",
    "Alipay = int(input(\"请输入余额：\"))\n",
    "\n",
    "while Ture:\n",
    "    print(\"-----商品列表-----\")\n",
    "    for i in range(4):\n",
    "        print(i,good_list[i][0],str(good_list[i][1])+\"元\")\n",
    "        \n",
    "    user_choice = int(input(\"请输入商品编号\"))\n",
    "    if user_choice.isdigit:\n",
    "       \n",
    "if Alipay > good_list[user_choice][1]:\n",
    "        Alipay = Alipay - good_list[user_choice][1]\n",
    "        shopping_list.append(good_list[user_choice])\n",
    "        print(\"购买成功，您的余额还剩：%s元\"%(Alipay))\n",
    "        \n",
    "else:\n",
    "        print(\"余额不足\"+str(good_list[user_choice][1])+\"元，请更换支付方式\")\n",
    "        \n",
    "        elif user_choice ==\"Q\"\n",
    "            print(\"感谢购买\")\n",
    "            print(\"您的购物车，shopping_list\")\n",
    "            print(\"您的余额还有，Alipay\")\n",
    "            break\n",
    "        elif:\n",
    "            print(\"您输入的物品不存在\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "41595b36",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c157c4b1",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
